FROM php:8.1.1-fpm
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak \
    && echo &#39;deb http://mirrors.163.com/debian/ stretch main non-free contrib&#39; > /etc/apt/sources.list \
    && echo &#39;deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib&#39; >> /etc/apt/sources.list \
    && echo &#39;deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib&#39; >> /etc/apt/sources.list \

RUN apt-get update && apt-get install -y --no-install-recommends libfreetype6-dev libjpeg62-turbo-dev libpng-dev && docker-php-ext-configure gd && docker-php-ext-install gd

#### 安装其他扩展
RUN docker-php-ext-install mysqli pdo_mysql

# 安装composer
# RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
 
# 设置工作目录
WORKDIR /var/www
 
# 对外暴露端口
EXPOSE 9000
 
# 启动php-fpm服务
CMD ["php-fpm"]

LABEL Author="Liguanh"
LABEL Version="2024"
LABEL Description="PHP 8 开发环境镜像. "